home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 95 / MOBICLIC 95.ISO / pc / MWB_DATA / TCH095 / TCH095_02 / tch095_02.swf / scripts / frame_6 / DoAction.as
Text File  |  2007-06-28  |  1KB  |  77 lines

  1. function joueSon(my_MC, lListeSons, lNomSon, lFaitAvancer)
  2. {
  3.    trace(lNomSon);
  4.    lPosSon = getPos(lListeSons,lNomSon);
  5.    my_MC.gSonJoue = lPosSon;
  6.    my_MC.my_music.setVolume(30);
  7.    if(my_MC["my_comment_" + lPosSon] != undefined)
  8.    {
  9.       my_MC["my_comment_" + lPosSon].start();
  10.       if(lFaitAvancer === 1)
  11.       {
  12.          my_MC.gotoAndPlay(my_MC._currentframe + 1);
  13.       }
  14.    }
  15. }
  16. function stopSon(my_MC, lNomSon, lFaitAvancer)
  17. {
  18.    my_MC[lNomSon].stop();
  19.    if(my_MC.gMusicOn === 1)
  20.    {
  21.       my_MC.my_music.setVolume(70);
  22.    }
  23.    if(lFaitAvancer === 1)
  24.    {
  25.       my_MC.gotoAndPlay(my_MC._currentframe + 1);
  26.    }
  27. }
  28. function gimme2digits(X)
  29. {
  30.    if(X < 10)
  31.    {
  32.       lX = "0" + String(X);
  33.    }
  34.    else
  35.    {
  36.       lX = String(X);
  37.    }
  38.    return lX;
  39. }
  40. function getPos(lList, lValue)
  41. {
  42.    lPresent = -1;
  43.    i = 0;
  44.    while(i <= lList.length)
  45.    {
  46.       if(lList[i] == lValue)
  47.       {
  48.          lPresent = i;
  49.       }
  50.       i++;
  51.    }
  52.    return lPresent;
  53. }
  54. function trouvePosMax(lList)
  55. {
  56.    lMax = lList[0];
  57.    lPosMax = 0;
  58.    i = 1;
  59.    while(i <= lList.length)
  60.    {
  61.       if(lList[i] > lMax)
  62.       {
  63.          lMax = lList[i];
  64.          lPosMax = i;
  65.       }
  66.       i++;
  67.    }
  68.    return lPosMax;
  69. }
  70. function randRange(min, max)
  71. {
  72.    var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
  73.    return _loc1_;
  74. }
  75. gListeSons = gListST;
  76. gSonJoue = 0;
  77.